import { number } from 'echarts'
import { ref} from 'vue'
import type { DataInfo,Data3,Data,List} from '@/types/home'
export const useHome = ()=>{
    
    let data1:Data<number[]> = {
        msg:'',
        code:100,
        datas:[1,2]
    }
    
    let data2:Data2<number[]> = {
        msg:'',
        code:100,
        datas:[1,2]
    }
    // 泛型接口
interface Data2<Type> {
    msg:string,
    code:number,
    datas:Type
}
    let data3:Data3 = [
        {
            id:12,
            msg:'返回成功',
            data:[
                {
                    id:121,
                    name:'小明',
                    age:18,
                    info:'这是小明相关信息'
                }
            ]
        }
    ]
    let a = ref<List>([])
    
    // 泛型函数
    return {
        data1,
        data2,
        data3,
        a
    }
}